/****************************************************************************
** Form implementation generated from reading ui file 'control.ui'
**
** Created: 一  3月 29 11:23:22 2010
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.1.1   edited Nov 21 17:40 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "control.h"

#include <qvariant.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qspinbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>

#include "stdio.h"
#include "control.ui.h"
/* 
 *  Constructs a control as a child of 'parent', with the 
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
control::control( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )

{
    if ( !name )
	setName( "control" );

    fridiebox = new QGroupBox( this, "fridiebox" );
    fridiebox->setGeometry( QRect( 0, 0, 550, 210 ) );
    QFont fridiebox_font(  fridiebox->font() );
    fridiebox_font.setPointSize( 20 );
    fridiebox->setFont( fridiebox_font ); 

    onoff1 = new QSpinBox( fridiebox, "onoff1" );
    onoff1->setGeometry( QRect( 170, 50, 66, 36 ) );
    onoff1->setMaxValue( 1 );

    textlabel1 = new QLabel( fridiebox, "textlabel1" );
    textlabel1->setGeometry( QRect( 10, 51, 160, 40 ) );

    load1 = new QPushButton( fridiebox, "load1" );
    load1->setGeometry( QRect( 440, 90, 80, 45 ) );

    save1 = new QPushButton( fridiebox, "save1" );
    save1->setGeometry( QRect( 440, 150, 80, 45 ) );

    airconditionbox = new QGroupBox( this, "airconditionbox" );
    airconditionbox->setGeometry( QRect( 0, 210, 550, 220 ) );
    QFont airconditionbox_font(  airconditionbox->font() );
    airconditionbox_font.setPointSize( 20 );
    airconditionbox->setFont( airconditionbox_font ); 

    textlabel2 = new QLabel( airconditionbox, "textlabel2" );
    textlabel2->setGeometry( QRect( 20, 50, 160, 51 ) );

    onoffbox2 = new QSpinBox( airconditionbox, "onoffbox2" );
    onoffbox2->setGeometry( QRect( 180, 60, 72, 36 ) );
    onoffbox2->setMaxValue( 1 );

    temperaturebox = new QSpinBox( airconditionbox, "temperaturebox" );
    temperaturebox->setGeometry( QRect( 170, 130, 80, 36 ) );
    temperaturebox->setMaxValue( 30 );
    temperaturebox->setMinValue( 16 );

    textlabel3 = new QLabel( airconditionbox, "textlabel3" );
    textlabel3->setGeometry( QRect( 20, 120, 147, 51 ) );

    save2 = new QPushButton( airconditionbox, "save2" );
    save2->setGeometry( QRect( 440, 160, 80, 45 ) );

    load2 = new QPushButton( airconditionbox, "load2" );
    load2->setGeometry( QRect( 440, 100, 80, 45 ) );
    languageChange();
    resize( QSize(552, 427).expandedTo(minimumSizeHint()) );

    // signals and slots connections
    connect( load1, SIGNAL( clicked() ), this, SLOT( getSlot1() ) );
    connect( save1, SIGNAL( clicked() ), this, SLOT( setSlot1() ) );
    connect( load2, SIGNAL( clicked() ), this, SLOT( getSlot2() ) );
    connect( save2, SIGNAL( clicked() ), this, SLOT( setSlot2() ) );
}

/*
 *  Destroys the object and frees any allocated resources
 */
control::~control()
{
    // no need to delete child widgets, Qt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void control::languageChange()
{
    setCaption( tr( "Contral" ) );
    fridiebox->setTitle( tr( "Fridge" ) );
    textlabel1->setText( tr( "ON=1,OFF=0" ) );
    load1->setText( tr( "Load" ) );
    save1->setText( tr( "Save" ) );
    airconditionbox->setTitle( tr( "Air Condition" ) );
    textlabel2->setText( tr( "ON=1,OFF=0" ) );
    textlabel3->setText( tr( "Temperature:" ) );
    save2->setText( tr( "Save" ) );
    load2->setText( tr( "Load" ) );
}

